<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <script src="../js/vue.js"></script>
    </head>
    <body>
        <div id="app">
            <input type="text" v-on:keyup.enter="submit">
        </div>
        <script>
            var vm = new Vue({
                el:'#app',
                methods:{
                    submit(){
                        alert('提交成功！');
                        console.log('表单提交');
                    }
                }
            })
        </script>
    </body>
</html>